package whlogger.launcher.views.controller;

import java.util.HashMap;
import javax.swing.JPanel;
import whlogger.launcher.interfaces.jpanelcontroller.IJPanelController;
import whlogger.launcher.loginfields.views.controller.LogInJPanelController;
import whlogger.launcher.maincontent.views.controller.MainContentJPanelController;
import whlogger.launcher.progressbar.views.controller.ProgressBarJPanelController;
import whlogger.launcher.views.MainJPanel;

/**
 *
 * @author d3rbastl3r
 */
public class MainJPanelController implements IJPanelController{
    private MainJPanel jPanel;
    
    private HashMap<String, IJPanelController> components;
    
    public MainJPanelController(){
        this.jPanel = new MainJPanel();
        this.components = new HashMap();
        
        setPanels();
    }
    
    private void setPanels(){
        this.components.put(java.awt.BorderLayout.PAGE_START, new LogInJPanelController());
        this.components.put(java.awt.BorderLayout.CENTER, new MainContentJPanelController());
        this.components.put(java.awt.BorderLayout.PAGE_END, new ProgressBarJPanelController());
        
        for(String page : this.components.keySet()){
            this.jPanel.add(this.components.get(page).getJPanel(), page);
        }
    }
    
    @Override
    public JPanel getJPanel(){
        return this.jPanel;
    }
}
